package com.platform.admin.component.listener;

import com.platform.admin.service.ISysPermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author： yuanlai
 */
@Component
@AllArgsConstructor
public class InitResourcePermissionCache implements CommandLineRunner {

    private ISysPermissionService iSysPermissionService;

    @Override
    @ApiOperation("添加启动监听器：初始化角色权限")
    public void run(String... args) {
        iSysPermissionService.refreshPermRolesRules();
    }
}
